home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / EXGRAF3D / GRAF3D.H < prev    next >
Text File  |  1990-09-20  |  3KB  |  103 lines

  1. /************************************************************
  2.  
  3. Created: Tuesday, September 12, 1989 at 7:00 PM
  4.     Graf3D.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.     Copyright Apple Computer, Inc.    1985-1989
  9.     All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __GRAF3D__
  15. #define __GRAF3D__
  16.  
  17. #ifndef __QUICKDRAW__
  18. #include <Quickdraw.h>
  19. #endif
  20.  
  21. typedef Fixed XfMatrix[4][4];
  22.  
  23.  
  24. struct Point3D {
  25.     Fixed x;
  26.     Fixed y;
  27.     Fixed z;
  28. };
  29.  
  30. typedef struct Point3D Point3D;
  31. struct Point2D {
  32.     Fixed x;
  33.     Fixed y;
  34. };
  35.  
  36. typedef struct Point2D Point2D;
  37. struct Port3D {
  38.     GrafPtr grPort;
  39.     Rect viewRect;
  40.     Fixed xLeft;
  41.     Fixed yTop;
  42.     Fixed xRight;
  43.     Fixed yBottom;
  44.     Point3D pen;
  45.     Point3D penPrime;
  46.     Point3D eye;
  47.     Fixed hSize;
  48.     Fixed vSize;
  49.     Fixed hCenter;
  50.     Fixed vCenter;
  51.     Fixed xCotan;
  52.     Fixed yCotan;
  53.     char filler;
  54.     char ident;
  55.     XfMatrix xForm;
  56. };
  57.  
  58. typedef struct Port3D Port3D;
  59. typedef Port3D *Port3DPtr, **Port3DHandle;
  60.  
  61. #ifdef __cplusplus
  62. extern "C" {
  63. #endif
  64. pascal void InitGrf3D(Port3DHandle port);
  65. pascal void Open3DPort(Port3DPtr port); 
  66. pascal void SetPort3D(Port3DPtr port);
  67. pascal void GetPort3D(Port3DPtr *port); 
  68. pascal void MoveTo2D(Fixed x,Fixed y);
  69. pascal void MoveTo3D(Fixed x,Fixed y,Fixed z);
  70. pascal void LineTo2D(Fixed x,Fixed y);
  71. pascal void Move2D(Fixed dx,Fixed dy);
  72. pascal void Move3D(Fixed dx,Fixed dy,Fixed dz); 
  73. pascal void Line2D(Fixed dx,Fixed dy);
  74. pascal void Line3D(Fixed dx,Fixed dy,Fixed dz);
  75. /* Removed 'const' attribute for THC, leg 08/30/90    */
  76. /* pascal void ViewPort(const Rect *r);    */    
  77. pascal void ViewPort(Rect *r);
  78. pascal void LookAt(Fixed left,Fixed top,Fixed right,Fixed bottom);
  79. pascal void ViewAngle(Fixed angle); 
  80. pascal void Identity(void); 
  81. pascal void Scale(Fixed xFactor,Fixed yFactor,Fixed zFactor);
  82. pascal void Translate(Fixed dx,Fixed dy,Fixed dz);
  83. pascal void Pitch(Fixed xAngle);
  84. pascal void Yaw(Fixed yAngle);
  85. pascal void Roll(Fixed zAngle); 
  86. pascal void Skew(Fixed zAngle);
  87. /* Removed 'const' attribute for THC, leg 08/30/90 */
  88. /* pascal void Transform(const Point3D *src,Point3D *dst); */ 
  89. pascal void Transform(Point3D *src,Point3D *dst);
  90. /* Removed 'const' attribute for THC, leg 08/30/90 */
  91. /* pascal short Clip3D(const Point3D *src1,const Point3D *src2,Point *dst1,
  92.     Point *dst2); */
  93. pascal short Clip3D(Point3D *src1, Point3D *src2,Point *dst1,
  94.     Point *dst2);
  95. pascal void SetPt3D(Point3D *pt3D,Fixed x,Fixed y,Fixed z); 
  96. pascal void SetPt2D(Point2D *pt2D,Fixed x,Fixed y); 
  97. pascal void LineTo3D(Fixed x,Fixed y,Fixed z);
  98. #ifdef __cplusplus
  99. }
  100. #endif
  101.  
  102. #endif
  103.